clearvars -except Globaloption option

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% This code reads in the VAR dynamics and produce the Campbell-Shiller decomposition in the paper
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Load data

loaddata_4CIjoint_annual_cy;

ttime = [1947:2020];

output_rp = 0.03 - mean(cy * .5);

%% Estimation
run ../../tools/cs_estimation.m

%% steady-state upper bound calculation
upper = exp(pxbar)*(mean(taxrevgdp-spendgdp));

save('MAT/CS_ConvYield.mat','-regexp', '^(?!(option|Globaloption)$).');

%% bootstrap
run ../../tools/BS_compute.m

save 'MAT/Campbell_Shiller_CY' ttime s gdebt upper std_coeff output_rp pdT pdG CFT CFG DR taxrevgdp spendgdp




